package net.qiqb.spring.execution;

import net.qiqb.core.Qiqb;
import net.qiqb.core.build.QiqbBuilder;

/**
 * 命令执行入口
 */
public class CommandTemplate {

    private final QiqbBuilder qiqbBuilder;

    private Qiqb qiqb;

    public CommandTemplate(QiqbBuilder qiqbBuilder) {
        this.qiqbBuilder = qiqbBuilder;
    }


    public void executeCommand(Object... commandObject) {
        if (qiqb == null ){
            qiqb = qiqbBuilder.build();
        }
        qiqb.executeCommand(commandObject);
    }

}
